package a66weding.com.jiehuntong.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.andview.refreshview.recyclerview.BaseRecyclerAdapter;

import a66weding.com.jiehuntong.R;
import a66weding.com.jiehuntong.widgets.CircularImage;

/**
 * Created by admin on 2016/7/13.
 */
public class New_ProductsAdapter  extends BaseRecyclerAdapter<New_ProductsAdapter .ViewHolder> {

    private Context context;

    public New_ProductsAdapter(Context context){
        this.context = context;
    }

    @Override
    public ViewHolder getViewHolder(View view) {

        return new ViewHolder(view);
    }

    @Override
    public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType, boolean isItem) {
        View v = LayoutInflater.from(context).inflate(
                R.layout.item_jobedit_optimal_commodity, parent, false);
        ViewHolder holder = new ViewHolder(v);
        return holder;
    }

    @Override
    public void onBindViewHolder(ViewHolder holder, int position, boolean isItem) {

    }

    @Override
    public int getAdapterItemCount() {
        return 6;
    }

    public class ViewHolder extends RecyclerView.ViewHolder {

        //最热的图标;
        private ImageView mostpopular;
        //用户头镖
        private CircularImage head;
        //收藏
        private ImageView option_collect;
        //用户名字
        private TextView name;
        public ViewHolder(View itemView) {
            super(itemView);
            mostpopular = (ImageView) itemView.findViewById(R.id.mostpopular);
            option_collect = (ImageView) itemView.findViewById(R.id.option_collect);
            head = (CircularImage) itemView.findViewById(R.id.optinal_commodity_head);
            name = (TextView) itemView.findViewById(R.id.optinal_commodity_name);
        }
    }
}
